<?php

namespace common\model;

use think\model\RelationModel;

class TenantGroupModel extends RelationModel
{
    protected $_validate = [
        ['tenant_id', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT],//必须字段
        ['tenant_id', '', '', self::MUST_VALIDATE, 'integer', self::MODEL_INSERT],//必须字段
        ['created_by', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT],//必须字段
        ['created_by', '', '', self::MUST_VALIDATE, 'integer', self::MODEL_INSERT],//必须字段
        ['name', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT],//必须字段
        ['status', ['active', 'invalid'], '', self::EXISTS_VALIDATE, 'in']
    ];

    // 自动完成
    protected $_auto = [
        ['created', 'time', self::MODEL_INSERT, 'function'],
        ['updated', 'time', self::MODEL_UPDATE, 'function']
    ];
}